<!DOCTYPE html>
<html>
<head>
    <title>团队表</title>
    <#include "/header.html">
    <!-- 文件上传 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/oss/style.css">
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/js/plupload.full.min.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/ziyun_library.js"></script>
    <!-- 图片预览 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/viewer/viewer.min.css">
    <script src="${request.contextPath}/statics/plugins/viewer/viewer.min.js"></script>
</head>
<body>
<div id="app">
    <div>
        <el-form :inline="true" v-model="q">
            <el-button type="primary" size="medium" icon="el-icon-search" @click="search"></el-button>
            <el-button type="primary" size="medium" @click="rest">重置</el-button>
            <el-form-item>
                <el-input v-model="q.teamName" placeholder="团队名"></el-input>
            </el-form-item>
            <el-form-item>
                <el-input v-model="q.mobile" placeholder="手机号码"></el-input>
            </el-form-item>
            <el-select v-model="q.sourceType" placeholder="分销类型">
                <el-option label="一企推" value="together"></el-option>
                <el-option label="代理点二级分销" value="agent"></el-option>
                <el-option label="微信朋友圈推广" value="wechat"></el-option>
            </el-select>
            <el-select v-model="q.auditStatus" placeholder="审核状态">
                <el-option label="待审核" value=0></el-option>
                <el-option label="审核通过" value=1></el-option>
                <el-option label="已拒绝" value=2></el-option>
            </el-select>
        </el-form>

        <el-table ref="tableData" :data="tableData" style="width:100%" border highlight-current-row class="tb-edit"
                  :default-sort="{prop: 'updatetime', order: 'descending'}" @selection-change="handleSelectionChange" @row-click="handleclick">
            <el-table-column prop="teamId" label="团队ID" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="teamName" label="团队名" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="userId" label="团长ID" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="mobile" label="手机号码" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="createtime" label="创建时间" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="remark" label="团队备注" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="sourceType" label="团队分销类型" sortable show-overflow-tooltip :formatter="sourceTypeFormatter"></el-table-column>
            <el-table-column prop="updatetime" label="更新时间" sortable show-overflow-tooltip></el-table-column>
            <el-table-column prop="auditStatus" label="审核状态" sortable show-overflow-tooltip :formatter="auditStatusFormatter"></el-table-column>
            <el-table-column label="操作">
                <template scope="scope">
                    <!--<el-button size="small" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>-->
                    <el-button size="small" type="primary" @click="handleAudit(scope.$index, scope.row)">审核</el-button>
                </template>
            </el-table-column>
            <el-table-column v-if="false" prop="businessUrl" label="营业执照url" sortable show-overflow-tooltip></el-table-column>
            <el-table-column v-if="false" prop="idCardUrls" label="身份证url" sortable show-overflow-tooltip></el-table-column>
            <el-table-column v-if="false" prop="refuseReason" label="拒绝理由" sortable show-overflow-tooltip></el-table-column>
        </el-table>

        <div align="center">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
                           :page-sizes="[20, 50, 80, 100]" :page-size="pagesize" layout="total, sizes, prev, pager, next, jumper" :total="totalCount"
                           background>
            </el-pagination>
        </div>
    </div>

    <el-dialog title="团队审核" :visible.sync="dialogFormVisible" width="60%">
        <el-form :inline="true">
            <el-row>
                <el-col :span="8">
                    <el-form-item label="团队名">
                        <el-input v-model="curRowData.teamName" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="手机号码">
                        <el-input v-model="curRowData.mobile" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="团队分销类型">
                        <el-input v-if="curRowData.sourceType=='together'" value="一企推" readonly></el-input>
                        <el-input v-if="curRowData.sourceType=='agent'" value="代理点二级分销" readonly></el-input>
                        <el-input v-if="curRowData.sourceType=='wechat'" value="微信朋友圈推广" readonly></el-input>
                        <el-input v-if="curRowData.sourceType=='second'" value="二级分销(不审)" readonly></el-input>
                    </el-form-item>
                </el-col>
                <div id="view">
                <el-col :span="8">
                    <el-form-item label="营业执照">
                            <img :src="window.parent.vm.ossHost+curRowData.businessUrl" style="width: 200px">
                        <!--<br><a class="btn btn-info btn-sm" id="uploadImage1">上传图片</a>-->
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="身份证图片">
                            <img :src="window.parent.vm.ossHost+idCardImgs[0]" style="width: 200px">
                            <!--<a class="btn btn-info btn-sm" id="uploadImage2">上传图片</a>-->
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="身份证图片">
                            <img :src="window.parent.vm.ossHost+idCardImgs[1]" style="width: 200px">
                            <!--<a class="btn btn-info btn-sm" id="uploadImage2">上传图片</a>-->
                    </el-form-item>
                </el-col>
                </div>
            </el-row>
            <el-row>
                <el-col :span="8">
                    <el-form-item label="拒绝理由">
                        <el-input v-model="curRowData.refuseReason" style="width: 260%"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" size="medium" @click="pass" :disabled="curRowData.auditStatus!=0">拒绝</el-button>
            <el-button type="primary" size="medium" @click="audit" :disabled="curRowData.auditStatus!=0">通过</el-button>
        </div>
    </el-dialog>
</div>

<script src="${request.contextPath}/statics/js/modules/userTeam/userteama.js?_${.now?long}"></script>
<style>
    /* 设置当前选中行的背景颜色 */
    .el-table__body tr.current-row>td {
        background: #c9eff5 !important;
    }
    /* 设置表主体的高度 */
    .el-table__body td,.el-table__body th{
        padding:3px;
    }
    /* 设置表头的高度 */
    .el-table__header td,.el-table__header th{
        padding:6px 0px;
    }
</style>
</body>
</html>
